package scigest.publish.solr;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import esg.search.publish.api.PublishingService;
import esg.search.utils.CertUtils;

public class HessianClient extends SolrPublisher {
		
		public static void main(final String[] args) throws Exception {

			// create and configure beans
			ApplicationContext ctx =
			    new ClassPathXmlApplicationContext(new String[] {"scigest.xml"});
			
	        final PublishingService publishingService = (PublishingService) ctx.getBean("publishingWebServiceProxy");
		    
	        // TODO: need to be integrated with ezpub configuration management to set the correct path
	        
	 	    // setup client certificate and trustore for mutual authentication
	        // CertUtils.setKeystore("esg/search/ws/hessian/client/client-cert.ks");
		    // CertUtils.setTruststore("esg/search/ws/hessian/client/localhost-client-trustore.ks");

		    final HessianClient self = new HessianClient();
		    self.run(publishingService, args);
			
		}
		
}
